Modification start date
[BattleCats.git] / Assets / EZ Object Pools / Scripts / PooledObjects / TimedDisable.cs
blob416c29296f6ee45b6ccf27365fb4690de0d98b80
1 using UnityEngine;
2 using EZObjectPools;
4 [AddComponentMenu("EZ Object Pools/Pooled Objects/Timed Disable")]
5 public class TimedDisable : PooledObject
7 float timer = 0;
8 public float DisableTime;
10 void OnEnable()
12 timer = 0;
15 void Update()
17 timer += Time.deltaTime;
19 if (timer > DisableTime)
21 transform.parent = ParentPool.transform;
22 gameObject.SetActive(false);